UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LEdOrOXCX52pv6g0WVpHR++LPdIuF08PRB7uSDskK+8='
WHERE
key_id = '98c6bbe7dc9d6d0ce6dd31300fe4905009d5ef24239e6a5085a2f1aed5218c0a'
AND (
token = 'LEdOrOXCX52pv6g0WVpHR++LPdIuF08PRB7uSDskK+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)