UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/EEjRBnaQoSoEmDvkI/ER8MIMBu7dx7qo691Bv1pEL4='
WHERE
key_id = 'aa804a6c06f67fbbea99accd29ee03c549c548c260edfe3a1d33bf8b32bef3dc'
AND (
token = '/EEjRBnaQoSoEmDvkI/ER8MIMBu7dx7qo691Bv1pEL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)