UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CfnpGsyDuXBEiE4F/JMoENqYYlKIzb0h7DcNh6n3/PQ='
WHERE
key_id = '88f0aacb6ce44853208e8df0136408cdc4a6e86f22f4c799123eca309efbaf95'
AND (
token = 'CfnpGsyDuXBEiE4F/JMoENqYYlKIzb0h7DcNh6n3/PQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)