UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YXCRPeZiN1D4Gp2vF3wLTJOM1m+2EFrwNXkJQhnZovo='
WHERE
key_id = 'c66f68510bbc12e61f5d15f997ab317fbba34f6f0df323074ba0754caacc8c8d'
AND (
token = 'YXCRPeZiN1D4Gp2vF3wLTJOM1m+2EFrwNXkJQhnZovo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)