UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/7YbOEBqAZhBTDHPHkIkPkimwFGVnn4sUV+7UgLwdtk='
WHERE
key_id = 'c9262e3c0208b8874fb96c330ea4e7ecedcac389bd59ca6a1e660ca8ac9b7689'
AND (
token = '/7YbOEBqAZhBTDHPHkIkPkimwFGVnn4sUV+7UgLwdtk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)