UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YfsNqpSrjuaRY/5qYFIGaqbSt+PF2mDhII+8711HiGY='
WHERE
key_id = 'ee4462069b70c925adcb7b1e4ce22985a2eb21150d729cf3ea65cafc4426e0a9'
AND (
token = 'YfsNqpSrjuaRY/5qYFIGaqbSt+PF2mDhII+8711HiGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)