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