UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P+GxyDEtQX3XhlgPYGq1x9hrHKQGmrvwBXaE1sPETjw='
WHERE
key_id = '1607fd8dfb004059123e102c0feba6f7aef91267c9842b429ec2b1cbe69d590d'
AND (
token = 'P+GxyDEtQX3XhlgPYGq1x9hrHKQGmrvwBXaE1sPETjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)