UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HW1Sgl9L44IT1IMsc19qyxkUQTNFhi8QRItzhMNPFHY='
WHERE
key_id = '405456f0376d96d5f265d89f46a6d8e5374f99a668459df7df325567444fdafa'
AND (
token = 'HW1Sgl9L44IT1IMsc19qyxkUQTNFhi8QRItzhMNPFHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)