UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FF/U9kr+Z2vDOX7BV2M8Co/dgxo44sxeqpGMijrooSU='
WHERE
key_id = '4907226de3078bc3d77a4532a169712ee0f3f3d1503c2e626446c7534405a345'
AND (
token = 'FF/U9kr+Z2vDOX7BV2M8Co/dgxo44sxeqpGMijrooSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)