UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8CrfxiXRkP9mAUE6xUfmbDdCMYAR3TIr4KU+kwCR2dI='
WHERE
key_id = 'fcffb7db9cfebfff96c9d492865f85eb6ddcf9bc7ace264e798ce7d5d4ed8f2e'
AND (
token = '8CrfxiXRkP9mAUE6xUfmbDdCMYAR3TIr4KU+kwCR2dI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)