UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kQOIlyrOJS0ltgxc41sfV4aY0OPCZl3bV+VIeDcrStA='
WHERE
key_id = '6c595068563330694f18382a0ccd5bf45ea1849cafd21e1c0a56bca003227839'
AND (
token = 'kQOIlyrOJS0ltgxc41sfV4aY0OPCZl3bV+VIeDcrStA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)