UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5vPE6PS2QWTSVriUqzH0QiGSNb/50VmoRe0XUFpLRrY='
WHERE
key_id = 'fc3c35273cf88cffd78f4f496c72e7b8b68f86ddd2dcb5f76ac90090488aa8cf'
AND (
token = '5vPE6PS2QWTSVriUqzH0QiGSNb/50VmoRe0XUFpLRrY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)