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