UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9y/bIekA1anuT8Y02/owp/7VLu25jVV0JCUbgv2UYoI='
WHERE
key_id = '96282938058c046a89aa5e5f633f4c1a61427a1cd05c71623e4029845efcc9b7'
AND (
token = '9y/bIekA1anuT8Y02/owp/7VLu25jVV0JCUbgv2UYoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)