UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IZzzUrk4bRQpsOYjgLpIxYTVmihIs8aS5YJ+JEuLqcM='
WHERE
key_id = '6dff811b406ed847c48c971901af9369bcf9dde927f3b37d65451c2727498649'
AND (
token = 'IZzzUrk4bRQpsOYjgLpIxYTVmihIs8aS5YJ+JEuLqcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)