UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NSIppZnNfylCeLCuJLoH9mQQz1IlfpiKG/K1m1dfqKg='
WHERE
key_id = '12314f05b5aa90cf8e25b1c2587d9e9cf784ca15d0c07c81486cc5d552a9d347'
AND (
token = 'NSIppZnNfylCeLCuJLoH9mQQz1IlfpiKG/K1m1dfqKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)