UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5CdYiY9wc8QnDPOCfWZei2uMmyMjkgrAEonL+Y4CBr0='
WHERE
key_id = '94b2ac9621bfbe492c086ac7a47bb9993e943249f5b852749b008acaa1bafd6f'
AND (
token = '5CdYiY9wc8QnDPOCfWZei2uMmyMjkgrAEonL+Y4CBr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)