UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KO4UeHRT4s/qMdLhIOSn94pqUn9PKsz2Q2UDkg5LrKU='
WHERE
key_id = '25e45f4a444ed8f4bec52cb6f14b8f50de77259f6c48512495c00e590805ed10'
AND (
token = 'KO4UeHRT4s/qMdLhIOSn94pqUn9PKsz2Q2UDkg5LrKU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)