UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mD7uQ0Mr6oweoRIiVk2V8p9Jn/+gbJBcIApsnaUqDig='
WHERE
key_id = '5015371bce6c4de533d2d9a5af915689090953cafbab6018a5d46044c320389c'
AND (
token = 'mD7uQ0Mr6oweoRIiVk2V8p9Jn/+gbJBcIApsnaUqDig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)