UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jgldcq2rqil+MZV33p8TOPYe0U2IR3+f93lmPz1zXlc='
WHERE
key_id = '022591600e9bdd9221c9aca42d9c942f88eda8371541049942fe9ec1069d4fb0'
AND (
token = 'Jgldcq2rqil+MZV33p8TOPYe0U2IR3+f93lmPz1zXlc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)