UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gjYsoqFLQ6xgju1edj6LAjST8bnoGLvDkthXLUlPUrU='
WHERE
key_id = 'a6ca1fcddaf620e3e280bf5a2de2ec126561922bf3a9ecacbb8ab53dee00af68'
AND (
token = 'gjYsoqFLQ6xgju1edj6LAjST8bnoGLvDkthXLUlPUrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)