UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4VCZeUpNlsLEYnBCO9kl0+2e0ZMnt8UDQ+haUsZOAPw='
WHERE
key_id = '686e3573652db2d959be77f9298ac4cf92436e8a37ecc2c68d6ede895ff172ee'
AND (
token = '4VCZeUpNlsLEYnBCO9kl0+2e0ZMnt8UDQ+haUsZOAPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)