UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kZEtbfw8Nymqo2tdPzd62wVMqPKYD1j7RaPoBzvCOdY='
WHERE
key_id = 'd1524b0368a6ad709d12b003eb6864eb71b573d17ee3ae893841f05bc6f9ed77'
AND (
token = 'kZEtbfw8Nymqo2tdPzd62wVMqPKYD1j7RaPoBzvCOdY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)