UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IsDymkwDQzdWjKIyePYM+/bUhpF6Xz/drWdEB7GzNPc='
WHERE
key_id = 'a471cc01fd438cb1744931de30cd2592f10436a57b183cfd0e11d918c9d9c1b3'
AND (
token = 'IsDymkwDQzdWjKIyePYM+/bUhpF6Xz/drWdEB7GzNPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)