UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'olz56JJ188nf+MDgMeWmRWFyRCPQTtVdpG0ikn0vS0A='
WHERE
key_id = '1f0ebc21bfe5b5e0ef2f1d58ca92d92e0dafdd25758034d12da622e6589c3f33'
AND (
token = 'olz56JJ188nf+MDgMeWmRWFyRCPQTtVdpG0ikn0vS0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)