UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ghbD71xkrF5hpfzABFWENQP0sgKIDbGb0Y6hp5kibSc='
WHERE
key_id = '57285ddee8503a589411bcc5f07a34bdfb7ff41ebde47b8bed7e53b5a8b63433'
AND (
token = 'ghbD71xkrF5hpfzABFWENQP0sgKIDbGb0Y6hp5kibSc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)