UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rMWtylWMzvh+4PYkeEFYcfiFep1MmTOR7NL5RnJM5uc='
WHERE
key_id = 'c1a2bc4a1d82ff062e5f7ad109804688359c9d1079caa037fcfe0e91e6beb939'
AND (
token = 'rMWtylWMzvh+4PYkeEFYcfiFep1MmTOR7NL5RnJM5uc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)