UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't5DUf8vcbEEpsQuvjtiTJfYJYcMUPjqIbhp3DA5IXdQ='
WHERE
key_id = '89f0d638814c707e5e5d15f6846b786cf72e12a6e6c509f48c761628ea206645'
AND (
token = 't5DUf8vcbEEpsQuvjtiTJfYJYcMUPjqIbhp3DA5IXdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)