UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qnmReYtaif35iTdiVSCs20+hxcFF/Oav6tIPwECR5II='
WHERE
key_id = 'ecca73c4ce7a4d4003e897159517c69087d4fb53fa1849b733a91fe77a17bdce'
AND (
token = 'qnmReYtaif35iTdiVSCs20+hxcFF/Oav6tIPwECR5II='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)