UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tx3fT6VUR/68KtY/gjDLBsino95brZwzn20I2nhZn6o=' 
WHERE 
  key_id = 'f0bd7cae975bb821d1282e89d8272ce7d463ae6284e3f06b9f507c389c56a420' 
  AND (
    token = 'Tx3fT6VUR/68KtY/gjDLBsino95brZwzn20I2nhZn6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041