UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JhaeEEeIXUq4W92cyTxmWCAwdiZKLgL+Zdtain1W75I='
WHERE
key_id = 'c88aec80531542e6a1831ed37a1ad2995619c7201d623651b3c919e89a9dc662'
AND (
token = 'JhaeEEeIXUq4W92cyTxmWCAwdiZKLgL+Zdtain1W75I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)