UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2LHp4brYwe24oxFcrYCnWstfoJ36d0LigSp92YysM+Y='
WHERE
key_id = '561a56985b9596393702f2802c474352174c7d2890aafe5830c40306465e83e5'
AND (
token = '2LHp4brYwe24oxFcrYCnWstfoJ36d0LigSp92YysM+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)