UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lxsz2LvIA9V9pxh4C2B6CdD3pdV5wI1elX0hOFf1hfY='
WHERE
key_id = 'aaf960fd00f13ee42b70d0e0ad587d3e651c37334a560b8dabdd61c4e812e2bc'
AND (
token = 'lxsz2LvIA9V9pxh4C2B6CdD3pdV5wI1elX0hOFf1hfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)